package com.chuyu.jzwboa.adapter.maillist;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.chuyu.jzwboa.R;
import com.facebook.drawee.view.SimpleDraweeView;

import java.util.List;

/**
 * Created by Administrator on 2017/12/16.
 */

public class MailListAdapter extends BaseAdapter {
	private Context mContext;
	private List<Integer> mList;

	public MailListAdapter(Context context, List<Integer> list) {
		this.mContext = context;
		this.mList = list;
	}

	@Override
	public int getCount() {
		return mList == null ? 0 : mList.size();
	}

	@Override
	public Object getItem(int i) {
		return null;
	}

	@Override
	public long getItemId(int i) {
		return 0;
	}

	@Override
	public View getView(int i, View view, ViewGroup viewGroup) {
		Viewholder holder;
		if (view == null) {
			holder = new Viewholder();
			view = View.inflate(mContext, R.layout.item_maillist, null);
			holder.maillist_photo = (SimpleDraweeView) view.findViewById(R.id.maillist_photo);
			holder.tv_mailist_name = (TextView) view.findViewById(R.id.tv_mailist_name);
			holder.tv_mailist_name_job = (TextView) view.findViewById(R.id.tv_mailist_name_job);
			holder.tv_mailist_phone = (TextView) view.findViewById(R.id.tv_mailist_phone);
			holder.iv_call_telephone = (ImageView) view.findViewById(R.id.iv_call_telephone);
			holder.iv_sendmsg = (ImageView) view.findViewById(R.id.iv_sendmsg);
			view.setTag(holder);
		} else {
			holder = (Viewholder) view.getTag();
		}
		holder.maillist_photo.setImageResource(R.mipmap.ic_launcher_round);
		return view;
	}

	class Viewholder {
		SimpleDraweeView maillist_photo;
		TextView tv_mailist_name;
		TextView tv_mailist_name_job;
		TextView tv_mailist_phone;
		ImageView iv_call_telephone;
		ImageView iv_sendmsg;
	}
}
